<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            background-color: bisque;
        }
    </style>
</head>
<body>
    <div>
        box
    </div>
    <script>
        const fnPromise1 = function(){
            return new Promise((reslove,reject)=>{
            setTimeout(()=>{
                const div1 = document.querySelector('div')
             div1.style.backgroundColor = 'pink'
            reslove('成功执行1')
            },2000)

            })
        }

        const fnPromise2 = function(){
            return new Promise((reslove,reject)=>{
            setTimeout(()=>{
                const div1 = document.querySelector('div')
             div1.style.backgroundColor = 'pink'
            reslove('成功执行2')
            },3000)

            })
        }

        const fnPromise3 = function(){
            return new Promise((reslove,reject)=>{
            setTimeout(()=>{
                const div1 = document.querySelector('div')
             div1.style.backgroundColor = 'pink'
            reject('失败')
            },3000)

            })
        }


        async function deom(){
          try {
            const retult1 = await fnPromise1(),
                  retult2 = await fnPromise2(),
                  retult3 = await fnPromise3()
            
            
            console.log(retult1);
            console.log(retult2);
            console.log(retult3);
          } catch (error) {
              console.log(error);
          }
        }
        deom()




    </script>
    
</body>
</html>